# -*- coding: utf-8 -*-
# author: sixmillions
# date: 2022/3/24

# 比较运算符
# == != > < >= <=

# 等于
a = 'str'
b = 'Str'
print(a == b)  # False

# 不等于
print(a != b)  # True

# 大于
c = 2
d = 4
print(c > d)  # False

# 小于
print(c < d)  # True

# 大于等于
print(c >= d)  # False

# 小于等于
print(c <= d)  # True

# 其他
e = 1
e += e >= 1
print(e)  # 2
# 转变成 e = e + (e >= 1)
print(e >= 1)  # True
print(1 + True)  # 2

# 字符串比较
print('abc' < 'abd')  # True
# 一个个比较，然后比较c和d的acs码表
print(ord('c'))  # 99
print(ord('d'))  # 100

# 列表元组比较，比较元素
print([1, 2, 3] < [3, 4])  # True
print((3, 4) > (5, 6))  # False

# 其他
print('中' > 'US')  # True
print(ord('中'))  # 20013
print(ord('U'))  # 85
